package com.example.common.exception;

/**
 * @Author: ChenZhiXiang
 * @Date: 2019/6/16 11:41
 * @Description: 参数异常
 */
public class ParameterException extends IException{

    private static final long serialVersionUID = 2085600730834011487L;

    public ParameterException(){
        super();
    }

    public ParameterException(String message){
        super(message);
    }

    public ParameterException(Integer code,String message){
        super(code,message);
    }

    @Override
    public Integer getCode() {
        Integer code = super.getCode();
        if (code == null){
            code = 400;
        }
        return code;
    }

    @Override
    public String getMessage() {
        String message = super.getMessage();
        if (message == null){
            message = "参数错误";
        }
        return message;
    }
}
